package com.hhkj.admin.sale.domain;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.common.core.domain.BizBaseEntity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 记录每笔分佣情况
 * @TableName s_sale_commission
 */
@TableName(value ="s_sale_commission")
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class SaleCommission extends BizBaseEntity{
    /**
     * 类型编码 signUp 报名 takeFromChild 推荐
     */
    @TableField(value = "type_code")
    private String typeCode;

    /**
     * 订单实际金额
     */
    @TableField(value = "order_price")
    private BigDecimal orderPrice;

    @Excel(name = "退款金额", orderNum = "3", width = 30, type = 10, numFormat = "#,##0.00")
    private BigDecimal refundPrice;

    /**
     * 固化返利百分比，对应s_conf_commission_rule，根据level_code判断直接间接
     */
    @TableField(value = "rate")
    @Excel(name = "返佣比例（%）", orderNum = "4", width = 30, type = 10, numFormat = "0.00")
    private BigDecimal rate;

    /**
     * 返利级别："thisLevel"-本级返利 "upOneLevel"-上级返利
     */
    @TableField(value = "level_code")
    private String levelCode;

    /**
     * 关联的订单id，关联x_order
     */
    @TableField(value = "order_id")
    private Long orderId;

    /**
     * 佣金状态："fixed"-已经固定的 "flow"-变动的
     */
    @TableField(value = "status_code")
    private String statusCode;

    /**
     * 获利商家，关联s_sale
     */
    @TableField(value = "sale_id")
    private Long saleId;

    /**
     * 销售编号
     */
    @TableField(value = "sale_num")
    private String saleNum;

    /**
     * 固化商家名称，关联s_sale
     */
    @TableField(value = "sale_name")
    private String saleName;

    /**
     * 返佣金额
     */
    @TableField(value = "price")
    @Excel(name = "本单返利", orderNum = "5", width = 30, type = 10, numFormat = "#,##0.00")
    private BigDecimal price;
}